home *** CD-ROM | disk | FTP | other *** search
- Path: damage.usa1.net!news
- From: crb3@usa1.com (crb3@usa1.com)
- Newsgroups: comp.lang.c
- Subject: Re: Printing to LPT1 Printer from within program
- Date: Wed, 31 Jan 1996 03:52:35 GMT
- Organization: USAinternet, Inc.
- Message-ID: <4emorv$782@damage.usa1.net>
- References: <4e5ee9$m28_001@pr.mcs.net>
- NNTP-Posting-Host: wmn1-222.usa1.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- Quoth mdp@mika-sys.com (Michael D. Perry):
-
- >I have just started taking a C programming class and am using Borland
- >C++ v4.0 at home. Both my teacher and I are stumped as to how to
- >print to a LPT (Line Printer) device from within the program.
-
- (Noticing Pleimling's and Hutto's responses) ...and, as long as the
- obligatory declaration has been made that this is OS-specific stuff,
- and the more portable methods have been described, I'll drop this on
- the table:
-
- [from Turbo C 2.0 manual... the function name also appears in BC3.1
- libs -- sorry, my BC3.1 books on wrong side of continent for a quick
- paper check -- so presumably the function's the same throughout the
- product line]
-
- int biosprint(int cmd, int abyte,int port);
- printer I/O using BIOS services directly
- prototype: bios.h
- port:
- 0= lpt1 .. 2= lpt3
- abyte: 0..255
- cmd:
- 0 - print abyte
- 1 - init printer port
- 2 - read printer status
- that's the most direct way to write to a *specific* printer in a
- Borland C program. Put the portable method in the program too, though;
- else how can you allow the user to print-to-disk?
- --cr
-
-
-